{extend name="layout" /}
{block name="content"}
<div class="mui-content">
	<!--block tab切換-->
	<div class="tm-label-lgm tm-bg-white uk-margin-small-top">
		<div class="main-content">
			<div class="main-tab">
				<div id="segmentedControl" class="mui-segmented-control mui-segmented-control-itme3">
					<a class="mui-control-item tm-icon-btn mui-active" href="#item1">
						<div class="tm-label-item">
							<div class="tm-label">
								创意海报
							</div>
						</div>
					</a>
					<a class="mui-control-item tm-icon-btn" href="#item2">
						<div class="tm-label-item">
							<div class="tm-label">
								精彩文章
							</div>
						</div>
					</a>

				</div>
			</div>
		</div>
	</div>

	<div class="main-tab-con tm-border-top">

		<!--切换1-->
		<div id="item1" class="mui-control-content mui-active">
			<div class="tm-label tm-bg-white">
				{volist name=":get_model_func('MemberShare', 'list_datas', $_userid, 4)" id="v"}
				<div class="tm-flex-row">
					<div class="main-content">
						<div class="tm-flex-row">
							<span class="tm-df-size tm-font-gray">{$v.title}</span>
						</div>
						<div class="tm-flex-row share-grid">
							<ul class="uk-grid">
								{volist name="v.list" id="vc"}
								<li class="uk-width-1-3">
									<a href="javascript:" onclick="coco_load_album('{$vc.thumb}', 0)"><img src="{$vc.thumbnail}" alt="" /></a>
								</li>
								{/volist}
							</ul>
						</div>
					</div>
				</div>
				{/volist}
			</div>
		</div>
		<!--切换1 end-->
		<!--切换2-->
		<div id="item2" class="mui-control-content">
			{volist name=":get_model_func('MemberShare', 'list_datas', $_userid, 5)" id="v"}
			<div class="group">
				<div class="tm-label">
					<div class="main-content">
						<div class="tm-flex-row">
							<span class="tm-df-size tm-font-gray">{$v.title}</span>
						</div>
					</div>
				</div>
				<div class="list tm-label tm-bg-white">
					{volist name="v.list" id="vc"}
					<a href="{$vc.linkurl . '&token=' . $token . '&timestamp=' . time()}" class="tm-block tm-flex-row">
						<div class="main-content tm-df-size">
							<div class="tm-flex-row">
								<div class="tm-inline-1-3">
									{$vc.title}
								</div>
							</div>
							<div class="tm-flex-row">
								<div class="tm-icon">
									<img src="{$vc.thumb}" alt="" />
								</div>
							</div>
						</div>
					</a>
					{/volist}
				</div>
			</div>
			{/volist}
		</div>
		<!--切换2 end-->
	</div>
	<!--block tab切換 end-->
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function(){
    	c3_navtive_user.right_button_item1 = {
            title:"{$images_path}statistics-black.png",
            callback:function(){
                var content = new Array();
                content['url'] = "{$app_url}/index/member/share_record/noheader/1";
                content['target'] = "blank";
                c3_navtive_user.doActionAnsy('gotopage',content,function(){});
            }
        };
        c3_navtive_user.right_button_item2 = {
            title:"截图上传",
            callback:function(){
                var msgarr = new Array();
				msgarr['uptype'] = 1;
				c3_navtive_user.doActionAnsy('open_gallery',msgarr,function(data){
					var datajson = {};
					datajson.thumb = data;
					$.ajax({
						url: "{:url('v1/adminuser/sharethumb_add')}",
						type:'post',
						dataType: 'json',
						data: datajson,
						beforeSend: function(request) {
							request.setRequestHeader("token", token);
							request.setRequestHeader("timestamp", timestamp);
						},
						error: function (XMLHttpRequest, textStatus, errorThrown) {
							coco_close_loading();
							var codetext = XMLHttpRequest.responseText;
							codejson = eval("(" + codetext + ")");
							coco_alert(codejson.msg);
							return false;
						},
						success:function(datajson){
							coco_msg('上传成功');
						}
					})
				});
            }
        };
       	 var button_item = [
            {
                title: "{$images_path}statistics-black.png",
                returnTag:'1'
            },{
            	title: "截图上传",
                returnTag:'2'
            }
        ];
        if("undefined" != typeof CocoObj){
            c3_navtive_user.doActionFunc("configMenu",button_item,function(datas){
                returntag = eval('(' + datas + ')');
                if(returntag.returnTag == 1){
                    var content = new Array();
	                content['url'] = "{$app_url}/index/member/share_record/noheader/1";
	                content['target'] = "blank";
	                c3_navtive_user.doActionAnsy('gotopage',content,function(){});
                }
                else if(returntag.returnTag == 2){
                    var msgarr = new Array();
					msgarr['uptype'] = 1;
					c3_navtive_user.doActionAnsy('open_gallery',msgarr,function(data){
						var datajson = {};
						datajson.thumb = data;
						$.ajax({
							url: "{:url('v1/adminuser/sharethumb_add')}",
							type:'post',
							dataType: 'json',
							data: datajson,
							beforeSend: function(request) {
								request.setRequestHeader("token", token);
								request.setRequestHeader("timestamp", timestamp);
							},
							error: function (XMLHttpRequest, textStatus, errorThrown) {
								coco_close_loading();
								var codetext = XMLHttpRequest.responseText;
								codejson = eval("(" + codetext + ")");
								coco_alert(codejson.msg);
								return false;
							},
							success:function(datajson){
								coco_msg('上传成功');
							}
						})
					});
                }
            });
        }
    })
</script>
{/block}